<html>
    <head>
        <meta>
    </head>
    <body>
        <script>

                     var hookRE = /^hook:/; 
 
                     console.log('hook'.match(hookRE))
                  console.log('hook:'.match(hookRE))
                  console.log('hook:abcd'.match(hookRE))
               
        </script>
    </body>
</html>